package org.gd.hellojaxb.privat24.regular;

import org.gd.hellojaxb.adapters.BooleanAdaptersFactory;
import org.gd.hellojaxb.adapters.DateAdaptersFactory;
import org.gd.hellojaxb.adapters.DoubleAdaptersFactory;

import javax.xml.bind.annotation.*;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import java.util.Date;

@XmlRootElement(name = "request")
@XmlAccessorType(XmlAccessType.FIELD)
@SuppressWarnings("unused")
public class CreateRegularPayRequest {

    @XmlRootElement(name = "id")
    @XmlAccessorType(XmlAccessType.FIELD)
    @XmlType(propOrder = {"userId"})
    public static final class Request {
        /** карта плательщика */
        @XmlAttribute(name = "Pan_a")
        private String producerCard;
        /** срок действия карты плательщика */
        @XmlAttribute(name = "Expd_a")
        private String producerCardEXPD;
        /**  */
        @XmlAttribute(name = "bank")
        private RegularPayBank bank;
        /** МФО плательщика */
        @XmlAttribute(name = "Mfo_a")
        private Long producerMFO;
        /** ОКПО плательщика */
        @XmlAttribute(name = "Okpo_a")
        private Long producerOKPO;
        /** наименование счета плательщика */
        @XmlAttribute(name = "Name_a")
        private String producerName;
        /** валюта от правителя */
        @XmlAttribute(name = "CCY_a")
        private String producerCCY;
        /** бранч карты плательщика */
        @XmlAttribute(name = "Branch_a")
        private String producerBranch;
        /** счет получателя */
        @XmlAttribute(name = "Acc_b")
        private String consumerAccount;
        /** карта(0), счет(1) */
        @XmlAttribute(name = "IsAccB")
        @XmlJavaTypeAdapter(BooleanAdaptersFactory.Integer.class)
        private Boolean isConsumerAccount;
        /** срок действия получателя */
        @XmlAttribute(name = "Expd_b")
        private String consumerEXPD;
        /** МФО получателя */
        @XmlAttribute(name = "Mfo_b")
        private Long consumerMFO;
        /** ОКПО получателя */
        @XmlAttribute(name = "Okpo_b")
        private Long consumerOKPO;
        /** наименование счета получателя */
        @XmlAttribute(name = "Name_b")
        private String consumerName;
        /** валюта получателя */
        @XmlAttribute(name = "CCY_b")
        private String consumerCCY;
        /** дата начала оплаты */
        @XmlAttribute(name = "DateStart")
        @XmlJavaTypeAdapter(DateAdaptersFactory.StatementsDateFormat.class)
        private Date dateStart;
        /** период(M – ежемесячный, W – еженедельный, D – ежедневный, А – другой) */
        @XmlAttribute(name = "Period")
        private RegularPayPeriod period;
        /** день */
        @XmlAttribute(name = "DayNum")
        private Integer dayNumber;
        /** сумма платежа */
        @XmlAttribute(name = "PmSum")
        @XmlJavaTypeAdapter(DoubleAdaptersFactory.Amount.class)
        private Double amount;
        /** логин операциониста */
        @XmlAttribute(name = "CR_Login")
        private String operatorLogin;
        /** выводить резалтсет Y-да */
        @XmlAttribute(name = "WithRez")
        private RegularPayResult withRez;
        /** состояние платежа(А – активный, I – не активный) */
        @XmlAttribute(name = "State")
        private RegularPayState state;
        /** тип платежа */
        @XmlAttribute(name = "DebitCommName")
        private String payType;
        /** дата остановки платежа */
        @XmlAttribute(name = "DateStop")
        @XmlJavaTypeAdapter(DateAdaptersFactory.StatementsDateFormat.class)
        private Date dateStop;
        /** логин привлекшего */
        @XmlAttribute(name = "LDAPPr")
        private String ldap;
        /** пополнение вклада банка */
        @XmlAttribute(name = "RegName")
        private String regularPayName;
        /** назначение платежа */
        @XmlAttribute(name = "PmName")
        private String PmName;
        /** идентификатор клиента в ЕКБ */
        @XmlAttribute(name = "Clid")
        private Long userId;
        /**  */
        @XmlAttribute(name = "Err")
        private String error;

        public Request() {
        }

        public String getProducerCard() {
            return producerCard;
        }

        public Request setProducerCard(String producerCard) {
            this.producerCard = producerCard;
            return this;
        }

        public String getProducerCardEXPD() {
            return producerCardEXPD;
        }

        public Request setProducerCardEXPD(String producerCardEXPD) {
            this.producerCardEXPD = producerCardEXPD;
            return this;
        }

        public RegularPayBank getBank() {
            return bank;
        }

        public Request setBank(RegularPayBank bank) {
            this.bank = bank;
            return this;
        }

        public Long getProducerMFO() {
            return producerMFO;
        }

        public Request setProducerMFO(Long producerMFO) {
            this.producerMFO = producerMFO;
            return this;
        }

        public Long getProducerOKPO() {
            return producerOKPO;
        }

        public Request setProducerOKPO(Long producerOKPO) {
            this.producerOKPO = producerOKPO;
            return this;
        }

        public String getProducerName() {
            return producerName;
        }

        public Request setProducerName(String producerName) {
            this.producerName = producerName;
            return this;
        }

        public String getProducerCCY() {
            return producerCCY;
        }

        public Request setProducerCCY(String producerCCY) {
            this.producerCCY = producerCCY;
            return this;
        }

        public String getProducerBranch() {
            return producerBranch;
        }

        public Request setProducerBranch(String producerBranch) {
            this.producerBranch = producerBranch;
            return this;
        }

        public String getConsumerAccount() {
            return consumerAccount;
        }

        public Request setConsumerAccount(String consumerAccount) {
            this.consumerAccount = consumerAccount;
            return this;
        }

        public Boolean getIsConsumerAccount() {
            return isConsumerAccount;
        }

        public Request setIsConsumerAccount(Boolean consumerAccount) {
            this.isConsumerAccount = consumerAccount;
            return this;
        }

        public String getConsumerEXPD() {
            return consumerEXPD;
        }

        public Request setConsumerEXPD(String consumerEXPD) {
            this.consumerEXPD = consumerEXPD;
            return this;
        }

        public Long getConsumerMFO() {
            return consumerMFO;
        }

        public Request setConsumerMFO(Long consumerMFO) {
            this.consumerMFO = consumerMFO;
            return this;
        }

        public Long getConsumerOKPO() {
            return consumerOKPO;
        }

        public Request setConsumerOKPO(Long consumerOKPO) {
            this.consumerOKPO = consumerOKPO;
            return this;
        }

        public String getConsumerName() {
            return consumerName;
        }

        public Request setConsumerName(String consumerName) {
            this.consumerName = consumerName;
            return this;
        }

        public String getConsumerCCY() {
            return consumerCCY;
        }

        public Request setConsumerCCY(String consumerCCY) {
            this.consumerCCY = consumerCCY;
            return this;
        }

        public Date getDateStart() {
            return dateStart;
        }

        public Request setDateStart(Date dateStart) {
            this.dateStart = dateStart;
            return this;
        }

        public RegularPayPeriod getPeriod() {
            return period;
        }

        public Request setPeriod(RegularPayPeriod period) {
            this.period = period;
            return this;
        }

        public Integer getDayNumber() {
            return dayNumber;
        }

        public Request setDayNumber(Integer dayNumber) {
            this.dayNumber = dayNumber;
            return this;
        }

        public Double getAmount() {
            return amount;
        }

        public Request setAmount(Double amount) {
            this.amount = amount;
            return this;
        }

        public String getOperatorLogin() {
            return operatorLogin;
        }

        public Request setOperatorLogin(String operatorLogin) {
            this.operatorLogin = operatorLogin;
            return this;
        }

        public RegularPayResult getWithRez() {
            return withRez;
        }

        public Request setWithRez(RegularPayResult withRez) {
            this.withRez = withRez;
            return this;
        }

        public RegularPayState getState() {
            return state;
        }

        public Request setState(RegularPayState state) {
            this.state = state;
            return this;
        }

        public String getPayType() {
            return payType;
        }

        public Request setPayType(String payType) {
            this.payType = payType;
            return this;
        }

        public Date getDateStop() {
            return dateStop;
        }

        public Request setDateStop(Date dateStop) {
            this.dateStop = dateStop;
            return this;
        }

        public String getLdap() {
            return ldap;
        }

        public Request setLdap(String ldap) {
            this.ldap = ldap;
            return this;
        }

        public String getRegularPayName() {
            return regularPayName;
        }

        public Request setRegularPayName(String regularPayName) {
            this.regularPayName = regularPayName;
            return this;
        }

        public String getPmName() {
            return PmName;
        }

        public Request setPmName(String pmName) {
            PmName = pmName;
            return this;
        }

        public Long getUserId() {
            return userId;
        }

        public Request setUserId(Long userId) {
            this.userId = userId;
            return this;
        }

        public String getError() {
            return error;
        }

        public Request setError(String error) {
            this.error = error;
            return this;
        }
    }

    @XmlElement(name = "id")
    private Request requestBody;

    public CreateRegularPayRequest() {
        requestBody = new Request();
    }

    public Request getRequestBody() {
        return requestBody;
    }
}
